import request from '../utils/request'

/**
 * 部门名字及人数
 * @returns {AxiosPromise}
 */
export const findDeptAndCount= () => {
    return request({
        url: '/department/findDeptAndCount',
        method: 'get'
    })
}

/**
 * 部门列表
 * @returns {AxiosPromise}
 */
export const deptList= (current,size,name) => {
    return request({
        url: '/department/deptList',
        method: 'get',
        params: {
            current,size,name
        }
    })
}

/**
 * 添加部门
 * @param department
 * @returns {AxiosPromise}
 */
export const deptAdd = (department) => {
    return request({
        url: '/department/addDept',
        method: 'post',
        data: department
    })
}
/**
 * 删除部门
 * @param id
 * @returns {AxiosPromise}
 */
export const deleteById = (id) =>{
    return request({
        url: '/department/deleteById',
        method: 'post',
        params: {id}
    })
}

/**
 * 到处excel表格
 * @returns {AxiosPromise}
 */
export const excel = () =>{
    return request({
        url: "/department/excel",
        method: "post",
        responseType: "blob"
    })
}